package com.sinosoft.ptas.system.web;

import java.util.List;

import org.apache.shiro.session.Session;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sinosoft.framework.core.api.domain.PmsData;
import com.sinosoft.framework.core.api.domain.ResourceEntity;
import com.sinosoft.framework.core.api.domain.RoleEntity;
import com.sinosoft.framework.core.api.domain.UserEntity;
import com.sinosoft.framework.core.api.service.ApplicationService;
import com.sinosoft.framework.core.api.service.DictService;
import com.sinosoft.framework.core.api.service.OrganizationService;
import com.sinosoft.framework.core.api.service.ParameterService;
import com.sinosoft.framework.core.api.service.ResourceService;
import com.sinosoft.framework.core.api.service.RoleService;
import com.sinosoft.framework.core.api.service.UserService;
import com.sinosoft.framework.core.common.utils.ajax.ResponseData;
import com.sinosoft.ptas.system.commom.PtasConstant;
import com.sinosoft.ptas.system.security.SecurityUtil;

@Controller
@RequestMapping("pms")
public class PmsController {
	@Autowired
	private OrganizationService organizationService;
	
	@Autowired
	private UserService userService;
	
	@Autowired
    private ApplicationService applicationService;
	
	@Autowired
	private ResourceService resourceService;
	
	@Autowired
	private RoleService roleService;
	
	@Autowired
	private ParameterService parameterService;
	
	@Autowired
	private DictService dictService;
	
	/**
	 * 获取当前用户应用上下文服务
	 * @return	回执数据：包含组织信息、用户信息、应用信息、资源信息、角色信息、参数信息、字典信息
	 */
	@RequestMapping(value="/getAppContext.service", method=RequestMethod.POST)
	@ResponseBody
	public ResponseData getAppUserData(String aid, String username ){
		/*aid = PtasConstant.system_aid;
		username = SecurityUtil.getUsername();
		PmsData pmsData=userService.getPmsData(aid, username);
		ResponseData response = new ResponseData(true, pmsData);*/
		PmsData pmsData = (PmsData)SecurityUtil.getSessionValue(PtasConstant.pms_app_content);
		ResponseData response = new ResponseData(true, pmsData);
		return response;
	}
}
